home *** CD-ROM | disk | FTP | other *** search
/ PC Gamer (Italian) 26 / PC Gamer IT CD 26 1-2.iso / MEDIA / NET.DXR / Internal_58.ls < prev    next >
Encoding:
Text File  |  1997-11-05  |  1.6 KB  |  60 lines

  1. on mouseUp
  2.   writeToFile()
  3. end
  4.  
  5. on writeToFile
  6.   global myFile, theLocation, finalPath
  7.   if the platform = "Windows,32" then
  8.     openXLib(the pathName & "XTRAS32\Fileio")
  9.   else
  10.     if the platform = "Windows,16" then
  11.       openXLib(the pathName & "XTRAS16\Fileio")
  12.     else
  13.       openXLib(the pathName & "xtras:FileIOXtraFat")
  14.     end if
  15.   end if
  16.   if objectp(myFile) then
  17.     set myFile to 0
  18.   end if
  19.   set myFile to new(xtra("fileio"))
  20.   setFilterMask(myFile, "ALL FILES, *.*, TEXT FILES, *.TXT")
  21.   set theLocation to displayOpen(myFile)
  22.   if not voidp(theLocation) then
  23.     checkFile()
  24.   else
  25.     alert("You did not select your Email Program.")
  26.   end if
  27.   set myFile to 0
  28. end
  29.  
  30. on checkFile
  31.   global myFile, theLocation, finalPath
  32.   if the platform = "Windows,32" then
  33.     openXLib(the pathName & "XTRAS32\Fileio")
  34.   else
  35.     if the platform = "Windows,16" then
  36.       openXLib(the pathName & "XTRAS16\Fileio")
  37.     else
  38.       openXLib(the pathName & "xtras:FileIOXtraFat")
  39.     end if
  40.   end if
  41.   put theLocation
  42.   put theLocation into field "emailSelect"
  43.   if objectp(myFile) then
  44.     set myFile to 0
  45.   end if
  46.   set myFile to new(xtra("fileio"))
  47.   set gOSDir to getOSDirectory()
  48.   set finalPath to gOSDir & "\"
  49.   openFile(myFile, finalPath & "Prefs.TXT", 0)
  50.   if status(myFile) = 0 then
  51.     delete(myFile)
  52.     closeFile(myFile)
  53.   end if
  54.   createFile(myFile, finalPath & "Prefs.TXT")
  55.   openFile(myFile, finalPath & "Prefs.TXT", 0)
  56.   writeString(myFile, field "cdDrive" & "," & field "browserSelect" & "," & field "pathToproj" & "," & field "emailSelect" & ",")
  57.   getPrefThingy()
  58.   loadBrowser()
  59. end
  60.